import request from "@/utils/request";
import { TableListItem } from "./data.d";
// 获取公告类型选项列表
export async function getAnnouncementTypeList(params?: any): Promise<any> {
  return request({
    url: "/announcement/announcementTypeList",
    method: "GET",
    data: params,
  });
}
// 用户列表
export async function getAnnouncePersonList(params): Promise<any> {
  return request({
    url: "/api/user/mgt/info/detail/query",
    method: "POST",
    data: params,
  });
}
// 公告列表
export async function queryList(params?: any): Promise<any> {
  return request({
    url: "/announcement/announcementList",
    method: "POST",
    data: params,
  });
}
// 创建公告
export async function createData(
  params: Omit<TableListItem, "id">
): Promise<any> {
  return request({
    url: "/announcement/create",
    method: "POST",
    data: params,
  });
}
// 更新公告
export async function updateData(
  params: Omit<TableListItem, "id">
): Promise<any> {
  return request({
    url: `/announcement/update`,
    method: "POST",
    data: params,
  });
}
// 删除公告
export async function removeData(params): Promise<any> {
  return request({
    url: `/announcement/delete`,
    method: "POST",
    data: params,
  });
}
// 发布公告
export async function publishData(params): Promise<any> {
  return request({
    url: `/announcement/publishAnnouncement`,
    method: "POST",
    data: params,
  });
}
// 获取公告详情
export async function detailData(params): Promise<any> {
  return request({
    url: "/announcement/getAnnouncementDetail",
    method: "GET",
    params: params,
  });
}
// 撤回公告
export async function withdraw(params): Promise<any> {
  return request({
    url: `/announcement/withdrawAnnouncement`,
    method: "POST",
    data: params,
  });
}
export async function queryUserList(params): Promise<any> {
  return request({
    url: "/api/user/mgt/info/detail/query",
    method: "POST",
    data: params,
  });
}
